package com.yongbao.model.util;

import com.yongbao.model.dtomapper.DishOrderBookDtoMapper;
import com.yongbao.model.domain.DishOrderBookDO;
import com.yongbao.model.vo.DishOrderBookVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class DishOrderBookConvert {

    public static List<DishOrderBookVO> buildDishOrderBookVoList(List<DishOrderBookDO> dishOrderBookDOList) {
        if (CollectionUtils.isEmpty(dishOrderBookDOList)) {
            return Lists.newArrayList();
        }
        List<DishOrderBookVO> dishOrderBookVOList = new ArrayList<>();
        for (DishOrderBookDO dishOrderBookDO : dishOrderBookDOList) {
            dishOrderBookVOList.add(DishOrderBookDtoMapper.INSTANCE.do2VO(dishOrderBookDO));
        }

        return dishOrderBookVOList;
    }
}
